package com.aloha.dao;

import com.aloha.po.User;

import java.util.HashMap;
import java.util.Map;

/**
 * @author DaiZhiHeng
 * @date 2023/7/22 16:07
 */
public class UserDao {
    private static final Map<String, User> USER_MAP = new HashMap<>();

    static {
        USER_MAP.put("1001", new User("1001", "dk1", "北京"));
        USER_MAP.put("1002", new User("1002", "dk2", "上海"));
        USER_MAP.put("1003", new User("1003", "dk3", "广州"));
        USER_MAP.put("1004", new User("1004", "dk4", "深圳"));
    }

    public UserDao() {
        System.out.println("UserDao的构造方法被执行了");
    }

    public User queryUserById(String id) {
        return USER_MAP.get(id);
    }
}

